don't use gtk_widget_keynav_failed(). Instead, look at
authorMichael Natterer <mitch@imendio.com>
Thu, 16 Nov 2006 14:32:47 +0000 (14:32 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Thu, 16 Nov 2006 14:32:47 +0000 (14:32 +0000)
2006-11-16  Michael Natterer  <mitch@imendio.com>

* gtk/gtkradiobutton.c (gtk_radio_button_focus): don't use
gtk_widget_keynav_failed(). Instead, look at gtk-keynav-cursor-only
and gtk-keynav-wrap-around and wrap around, beep or continue outside
the group manually (bug #322640).

ChangeLog
gtk/gtkradiobutton.c

index 129b65320096eb6fbae89e53d0d7d6b41b31c492..9d7a5ca6b3e1a459926eb0406a17e1dbe62fc4fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-11-16  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_focus): don't use
+       gtk_widget_keynav_failed(). Instead, look at gtk-keynav-cursor-only
+       and gtk-keynav-wrap-around and wrap around, beep or continue outside
+       the group manually (bug #322640).
+
 2006-11-16  Michael Natterer  <mitch@imendio.com>
 
        Add new infrastructure for notifications of failed keyboard
index 91bedc3f8178bad9b40bd208d2d67412af60ea7e..529a025886bb85f8d9e48c6cb2f2e68a40eae91e 100644 (file)
@@ -445,9 +445,12 @@ gtk_radio_button_focus (GtkWidget         *widget,
   
   if (gtk_widget_is_focus (widget))
     {
+      GtkSettings *settings = gtk_widget_get_settings (widget);
       GSList *focus_list, *tmp_list;
       GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
       GtkWidget *new_focus = NULL;
+      gboolean cursor_only;
+      gboolean wrap_around;
 
       switch (direction)
        {
@@ -489,14 +492,26 @@ gtk_radio_button_focus (GtkWidget         *widget,
            }
        }
 
+      g_object_get (settings,
+                    "gtk-keynav-cursor-only", &cursor_only,
+                    "gtk-keynav-wrap-around", &wrap_around,
+                    NULL);
+
       if (!new_focus)
        {
-          if (!gtk_widget_keynav_failed (widget, direction))
+          if (cursor_only)
             {
               g_slist_free (focus_list);
               return FALSE;
             }
 
+          if (!wrap_around)
+            {
+              g_slist_free (focus_list);
+              gtk_widget_error_bell (widget);
+              return TRUE;
+            }
+
          tmp_list = focus_list;
 
          while (tmp_list)
@@ -517,13 +532,6 @@ gtk_radio_button_focus (GtkWidget         *widget,
 
       if (new_focus)
        {
-          GtkSettings *settings = gtk_widget_get_settings (widget);
-          gboolean     cursor_only;
-
-          g_object_get (settings,
-                        "gtk-keynav-cursor-only", &cursor_only,
-                        NULL);
-
          gtk_widget_grab_focus (new_focus);
 
           if (!cursor_only)